#ifndef __COMMONERROR_H__
#define __COMMONERROR_H__

#include "common.h"
#include "Sensor.h"

extern void GetDirErr(Sensor_TypeDef * sensor,float * err);
extern void JudgeLost(Sensor_TypeDef * sensor,u8 * lostFlag);
extern void JudgeDirection(float * err,u8 * lostFlag,u8 * dirFlag);
extern void LostHandler(u8 * lostFlag,u8 * dirFlag,float * err);
extern void GetEigenValue(Sensor_TypeDef * sensor,u8 * lostFlag,float * eigenVal);
extern void GetWeight(float * eigen,float (* weightConf)[2],float * weight,u8 * wIndex);
extern void GetProcessedDirErr(float * weight,float * dirErr,float * error);

#endif  //__COMMONERROR_H__
